<template>
  <div id="bg">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item>系统管理</el-breadcrumb-item>
      <el-breadcrumb-item>审批流程管理</el-breadcrumb-item>
    </el-breadcrumb>
    <div id="tab">
      <div>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item label="角色名称">
            <el-input v-model="formInline.user" placeholder=""></el-input>
          </el-form-item>
          <el-form-item label="所属部门">
            <el-select v-model="formInline.depart" placeholder="请选择">
              <el-option label="区域一" value="shanghai"></el-option>
              <el-option label="区域二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="状态">
            <el-select v-model="formInline.state" placeholder="请选择">
              <el-option label="启用" value="open"></el-option>
              <el-option label="禁用" value="close"></el-option>
            </el-select>
          </el-form-item>
          <el-button type="primary" @click="onSearch">查询</el-button>
          <el-button type="info" @click="onReset">重置</el-button>
        </el-form>
      </div>
      <el-divider></el-divider>
      <el-button type="primary" @click="onSearch">新增</el-button>
      <div id="table">
        <el-table
          :data="tableData"
          stripe
          style="width: 100%">
          <el-table-column
            prop="id"
            label="ID"
            width="160">
          </el-table-column>
          <el-table-column
            prop="name"
            label="角色名称"
            width="160">
          </el-table-column>
          <el-table-column
            prop="department"
            label="部门"
            width="160">
          </el-table-column>
          <el-table-column
            prop="state"
            label="状态"
            width="160">
          </el-table-column>
          <el-table-column
            prop="operator"
            label="操作人"
            width="170">
          </el-table-column>
          <el-table-column
            prop="date"
            label="操作时间"
            width="200">
          </el-table-column>
          <el-table-column
            prop="operate"
            label="操作">
            <template slot-scope="scope">
              <el-button @click="handleClick(scope.row)" size="small">编辑</el-button>
              <el-button type="primary" size="small">查看</el-button>
              <el-button type="danger" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div id="pages">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage1"
          :page-sizes="[5, 10, 15, 20]"
          :page-size="5"
          layout="total, sizes, prev, pager, next, jumper"
          :total="30">
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    data:function(){
      return {
        formInline:{
          user:'',
          depart:'',
          state:''
        },
        tableData: [{
          id: '100001',
          name: '人事',
          department: '财务',
          state:'启用',
          operator:'系统管理员',
          date:'2022-03-08'
        }, {
          id: '2016-05-02',
          name: '王小虎',
          department: '财务',
          state:'启用',
          operator:'系统管理员',
          date:'2022-03-08'
        }, {
          id: '2016-05-02',
          name: '王小虎',
          department: '财务',
          state:'启用',
          operator:'系统管理员',
          date:'2022-03-08'
        }, {
          id: '2016-05-02',
          name: '王小虎',
          department: '财务',
          state:'启用',
          operator:'系统管理员',
          date:'2022-03-08'
        }, {
          id: '2016-05-02',
          name: '王小虎',
          department: '财务',
          state:'启用',
          operator:'系统管理员',
          date:'2022-03-08'
        }, {
          id: '2016-05-02',
          name: '王小虎',
          department: '财务',
          state:'启用',
          operator:'系统管理员',
          date:'2022-03-08'
        }],
        currentPage1: 1
      }
    },
    methods: {
      onSearch() {
        console.log('查询!');
      },
      onReset() {
        console.log('重置!');
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      }
    }
  }
</script>
<style scoped>
  .el-row span {
    cursor: pointer;
  }
  .el-main,
  #bg {
    height: 100%;
  }
  .el-breadcrumb {
    margin: 20px;
  }
  #closeBtn {
    text-align: right;
  }
  #bg {
    background-color: rgb(242,242,242);
  }
  #tab {
    padding: 30px;
    background-color: #fff;
    margin: 0 20px;
  }
  .el-breadcrumb {
    margin-top: 0;
    padding-top: 20px;
  }
  #pages {
    margin-top: 20px;
    text-align: right;
  }
</style>
